Event management system

ABSTRACT

One embodiment of an event management system, operating on a computer system having event producers and event consumers, includes an initial event handler program and an event queue having a first event. The initial event handler program retrieves the first event from the event queue for event processing. This event processing returns a first response to the initial event handler program, wherein the initial event handler program manages the first event on the event queue based on the first response.

THE FIELD OF THE INVENTION

The present invention generally relates to computer systems, and moreparticularly, to an event management system operating on a computersystem having event producers and event consumers.

BACKGROUND OF THE INVENTION

One type of conventional computer system, referred to as an event-basedsystem, relies on events to elicit actions. Event-based systems, includeevent producers and event consumers. Event producers create events andcommunicate these events to the system. Event consumers act on orprocess the events.

Event-based systems can have a small or large number of event producersand event consumers. A small event-based system may have only a fewevent producers and a few event consumers. In such small event-basedsystems, one event producer is often tied to one event consumer. Inlarger event-based systems, many event producers create events, whichare directed to many event consumers. In such large event-based systems,one event is often sent to many event consumers.

Generally, events are requests for some action. General event typesinclude user-input events, system messaging events, andinter-application events. User-input events are initialized by a systemuser and include events such as a keystroke, a mouse click, and a diskfile insertion. System messaging events are messages between anoperating system and an application program. Examples of systemmessaging events include requests to create a new file, display awindow, and change the contents of a file. Inter-application events arerequests for action between application programs including connecting toa network and communicating through a network. Each of these events isdirected to at least one event consumer for event processing.

Event management systems, which operate on event-based systems, manageevents. In small event-based systems, an event management system handlesa small number of events with a limited set of event consumers. In asmall event-based system, the event management system is often a seriesof computer program instructions or statements, which compare eventinformation to selected criteria and direct the event to the appropriateevent consumer. For example, an event management system can include aswitch statement with multiple cases written in C language code or aseries of if statements with jump instructions written in anotherlanguage. These decision-making statements are typically stored in oneor more source code files. Similarly, the event consumers are alsotypically stored in one or more source code files. The decision-makingstatements and event consumers are compiled together to create anexecutable program.

In small event-based systems, new event consumers may be added toincrease functionality. For example, new event consumers are added toaccommodate expanded user needs or for debugging and testing purposes.Adding a new event consumer typically involves changing thedecision-making code, adding the new event consumer to the source code,and recompiling to create a new executable program. Assuming that theold executable program was tested, adding a new event consumerdestabilizes the event-based system platform, which results inadditional system testing. Adding a new event consumer for debugging andtesting not only changes the code under test, but removing the debuggingand testing code destabilizes the tested event-based system platform.Although the new event consumer could be retained in the new code aftertesting, the new code would take up more memory space, which is often ata premium.

During operation, an event-based system receives an event from an eventproducer. In a small event-based system, this event is passed to thedecision-making statements. The decision-making statements compare theevent information to selected criteria, one at a time, until the eventinformation arrives at the appropriate case or if statement. Theexecutable program then calls the selected event consumer and the eventis processed. This event management operation is time consuming, and itis possible that during this event management operation, the event-basedsystem will not be able to respond to new events. Consequently, eventscan be dropped due to an overrun condition resulting from limitedresources. Also, other portions of the event-based system arepotentially starved for data while the system is processing events.

In larger event-based systems, the event management system handles alarge number of events using a large number of event consumers. Somelarger, more complex event management systems do not have the aboveproblems associated with small event management systems. Nevertheless,larger event management systems typically employ operating systemfacilities to manage events. For example, some large event managementsystems are implemented with multi-tasking facilities of the operatingsystem. In a multi-tasking environment, system functionality is dividedinto small functional units, such that a specific function is associatedwith a specific task. The operating system switches between these tasksto complete processing in an operation referred to as context switching.During context switching, copies of data being processed are stored inmemory, while other data are switched in for processing. Thus, themulti-tasking environment adds overhead to the event-based system in theform of processing time and memory requirements. The multi-taskingoverhead can significantly degrade system performance. In addition, insome systems the multi-tasking memory requirements exceed the amount ofavailable memory.

For reasons stated above and for other reasons presented in thedescription of the preferred embodiments section of the presentspecification, an improved event management system is desired which doesnot have the above problems associated with small event managementsystems and which can be implemented in a single-tasking environment.

SUMMARY OF THE INVENTION

One aspect of the present invention provides of an event managementsystem, operating on a computer system having event producers and eventconsumers. The event management system includes an initial event handlerprogram and an event queue having a first event. The initial eventhandler program retrieves the first event from the event queue for eventprocessing. The event processing returns a first response to the initialevent handler program. The initial event handler program manages thefirst event on the event queue based on the first response.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating one exemplary computer system onwhich an exemplary embodiment of an event management system, accordingto the present invention, is implemented.

FIG. 2 is a block diagram illustrating an exemplary embodiment of anevent management system, according to the present invention, incommunication with event producers and event consumers.

FIG. 3 is a block diagram illustrating an exemplary embodiment of aperformance path application program interface (API), according to thepresent invention.

FIG. 4 is a block diagram illustrating an exemplary embodiment of amethod for posting and retrieving events from a posted event queue,according to the present invention.

FIG. 5 is a diagram illustrating an exemplary embodiment of an eventdata structure for the events in a posted event queue.

FIG. 6 is a diagram illustrating an exemplary embodiment of a firstresponse to an initial event handler.

FIG. 7 is a block diagram illustrating an exemplary embodiment of aperformance path API configured to call an extended event API.

FIG. 8 is a block diagram illustrating an exemplary embodiment of anextended event API.

FIG. 9 is a diagram illustrating an exemplary embodiment of a secondresponse passed from an event consumer to an extended event handler.

FIG. 10 is a flow chart illustrating an exemplary embodiment of newevent processing, including immediately processing the new event andposting the new event.

FIG. 11 is a flow chart illustrating an exemplary embodiment of eventprocessing from a posted event queue in one exemplary embodiment of aperformance path API.

FIG. 12 is a flow chart illustrating the beginning of event processingthrough an exemplary embodiment of an extended event API.

FIG. 13 is a flow chart illustrating continued event processing throughan exemplary embodiment of an extended event API.

FIG. 14 is a flow chart illustrating event processing through anexemplary embodiment of a performance path API after returning from anexemplary embodiment of an extended event API.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

In the following detailed description of the preferred embodiments,reference is made to the accompanying drawings, which form a parthereof, and in which is shown by way of illustration specificembodiments in which the invention may be practiced. It is to beunderstood that other embodiments may be utilized and structural orlogical changes may be made without departing from the scope of thepresent invention. The following detailed description, therefore, is notto be taken in a limiting sense, and the scope of the present inventionis defined by the appended claims.

FIG. 1 is a block diagram illustrating one exemplary computer system 20on which an exemplary embodiment of an event management system accordingto the present invention is implemented. Computer system 20 is anevent-based system and includes a central processing unit (CPU) 22,storage devices 24, network facilities 26, an input/output (I/O)controller 28, and a memory 30, all electrically coupled to one anothervia a system bus 32. I/O controller 28 is also electrically coupled toinput/output (I/O) devices 34 via line 38. It is understood thatdifferent components could be substituted for the example illustratedcomponents of the computer system 20 and components could be added orremoved, without altering the present invention. It is also understoodthat an exemplary embodiment of the present invention could beimplemented in other event-based systems, such as a security system, anetwork switch, or a network server.

In one embodiment of computer system 20, the CPU 22 is a singlemicroprocessor. However, other event-based systems embodying the presentinvention, include other types of processing units, such as a mainframeprocessor, multiple processors, or a micro-controller.

In one embodiment, storage devices 24 includes a disk drive and anexternal storage device, such as a back up tape drive. One embodimentof, network facilities 26 includes a network card and a connection to anetwork, such as a local area network (LAN) or the Internet. I/Ocontroller 28 is suitably a controller card or an integrated controllerfor handling multiple input devices 34 and output devices 36. I/Odevices 34 and 36 can include a keyboard, a video monitor, a mouse, andother I/O devices such as sensors or RF interfaces. The above-describedcomponents of the computer system 20 are event producers.

Memory 30 stores software for controlling computer system 20. Memory 30typically includes volatile memory, such as RAM, and non-volatilememory, such as ROM, EEPROM, and Flash memory. The software storedmemory 30 includes an operating system 42, such as DOS, UNIX, Windows, aproprietary operating system, and/or other suitable operating systems.The software stored in memory 30 also includes an event managementsystem 44. CPU 22 executes operating system 42 and event managementsystem 44 to control the operation of computer system 20.

During operation, CPU 22 retrieves and executes instructions from memory30. Operating system 42 includes a main loop and CPU 22 executes themain loop and calls other programs as needed for processing. Events fromevent producers are received by operating system 42, which calls eventmanagement system 44. CPU 22 proceeds to execute event management system44 to process the received events. The received events includeuser-input events, system messaging events, and inter-applicationevents.

Example user-input events include keyboard presses and mouse clicks,which are retrieved by I/O controller 28. The user-input events are thenretrieved from I/O controller 28 by operating system 42, executing onthe CPU 22. Operating system 42 calls event management system 44 toprocess the user-input events.

System messaging events include messages between operating system 42 andother programs, for example, programs employed to control storagedevices 24. The system messaging events are retrieved from storagedevices 24 over system bus 32 by operating system 42, executing on theCPU 22. Operating system 42 calls event management system 44 to processthe system messaging events.

Inter-application events are requests for actions between applicationprograms, such as, for example, the requests for actions between anInternet browser application program and an application program residingon the Internet network. In this example situation, messages between thebrowser applications program, executing on CPU 22, and the networkapplication program pass through system bus 32 and network facilities26. Operating system 42 interacts with the browser application program,to receive events and call event management system 44 to process theinter-application events.

Event management system 44 processes events from event producers bycalling one or more event consumers. These event consumers are oftenprograms residing in memory 30 of computer system 20. The eventconsumers pass information to the components of computer system 20.

One exemplary embodiment of event management system 44 described hereinincludes an initial event handler 54 and a posted event queue 56 forstoring event information. Initial event handler 54 stores incomingevents at the end of posted event queue 56 and retrieves events from thebeginning of posted event queue 56. This event queuing operation buffersthe incoming events, which can prevent overrun conditions. Also, with anevent posted to posted event queue 56, memory associated with theprocessing of the event can be freed for use in other parts of computersystem 20.

One exemplary embodiment of event management system 44 also includes anextended event handler 90 for managing multiple event consumersassociated with the processing of one event. Extended event handler 90is accessed via an extended pointer table 94 having a pointer toextended event handler 90 in place of a pointer to a default eventconsumer. Initial event handler 54 calls extended event handler 90 toprocess events through multiple event consumers, which may or may notinclude the supplanted default event consumer. In one embodiment,extended event handler 90 calls one event consumer at a time, in serialfashion, going from one event consumer to the next until processing iscomplete. Retry information is stored and passed to initial eventhandler 54, which maintains the event on posted event queue 56 ifprocessing was not completed. Extended event handler 90 allows multipleevent consumers to be added without altering the default event consumercode or call routines. In this manner, processing is accomplished in anorderly fashion without taking an extraordinary amount of computersystem 20 processing time or memory resources.

FIG. 2 is a block diagram illustrating an exemplary embodiment of eventmanagement system 44 according to the present invention in communicationwith event producers 46 and event consumers 48. Event producers 46 canbe any of the components of the computer system 20. Event consumers 48are programs, which process or handle the events. Event managementsystem 44 is called by operating system 42 to process events from eventproducers 46. In turn, event management system 44 calls event consumers48. Operating system 42 and event management system 44 are executed onCPU 22. Similarly, event consumers 48 are also executed on CPU 22.

Event management system 44 includes a performance path applicationprogram interface (API) 50 and an extended event API 52. Performancepath API 50 is in communication with all event producers 46 a–46 n. Thenumber of event producers 46 a–46 n in computer system 20 can beexpanded to accommodate the needs of the user. Performance path API 50is in communication with a subset of the event consumers 48, includingevent consumers 48 a–48 n, which are tightly coupled to performance pathAPI 50. The number of event consumers 48 a–48 n can also be expanded toaccommodate the needs of the user.

Extended event API 52 can access all event consumers 48 a–48 z. Eventconsumers 48 o–48 z are consumers added to accommodate the needs of theuser. These additional event consumers 48 o–48 z can add increasedfunctionality to computer system 20, such as debugging and testingfunctions. The number of event consumers 48 o–48 z can also be expandedto accommodate the needs of the user.

One exemplary embodiment of performance path API 50 calls one of eventconsumers 48 a–48 n or, in the alternative, extended event API 52.Extended event API 52 calls selected ones of event consumers 48 a–48 zserially, to process an event. The event consumers 48 a–48 z can becalled in any order by extended event API 52. After processing, extendedevent API 52 passes control back to performance path API 50 andoperating system 42.

In operation, operating system 42 receives an event from an eventproducer 46 and calls event management system 44. Operating system 42passes the event information to performance path API 50, which receivesthe event for subsequent event processing. To process the event,performance path API 50 calls either a particular one of event consumers48 a–48 n or extended event API 52. The chosen one of event consumers 48a–48 n or extended event API 52 attempts to process the event and passesa first response back to performance path API 50. In one embodiment, thefirst response indicates that the event was successfully processed, aretry is in order, or the event was moved and stored in memory 30.

If called, extended event API 52 calls one of event consumers 48 a–48 zfrom a series of selected event consumers 48 a–48 z. The called one ofevent consumers 48 a–z attempts to process the event and if successfulpasses this information to extended event API 52 in a second response.Extended event API 52 determines if any more event consumers 48 a–48 zneed to be called. If the series of selected event consumers 48 a–48 zis complete, extended event API 52 passes a successful response toperformance path API 50. Alternatively, if the event is successfullyprocessed and the series of selected event consumers 48 a–48 z is notcomplete, extended event API 52 calls the next event consumer 48 in theseries.

Unsuccessful processing of an event results in a retry response passedto extended event API 52 and performance path API 50. This same event isprocessed by the same unsuccessful one of event consumers 48 a–48 z whenevent management system 44 is next called by operating system 42. Amoved response received in the second response is passed on toperformance path API 50.

Performance path API acts based on the first response from either one ofevent consumers 48 a–48 n or extended event API 52. If processing issuccessful, performance path API 50 either processes the next event orpasses control back to operating system 42. If processing is notsuccessful, a retry is performed. To initiate the retry, performancepath API 50 passes control to operating system 42. In this situation,event management system 44 attempts to process the same event when nextcalled by operating system 42. If the event is moved, performance pathAPI 50 either processes the next event or passes control to operatingsystem 42. A moved event will not be processed the next time eventmanagement system 44 is called by operating system 42.

FIG. 3 is a block diagram illustrating an exemplary embodiment ofperformance path API 50 according to the present invention. Performancepath API 50 includes an initial event handler 54, a posted event queue56, and an event processor pointer table 58. Initial event handler 54 isin communication with event producers 46 a–46 n and event consumers 48a–48 n. Initial event handler 54 has numerous functions. For example,initial event handler 54 controls posted event queue 56 and accessesevent processor pointer table 58. Initial event handler 54 receivesevents from event producers 46 a–46 n and posts events to posted eventqueue 56. Initial event handler 54 also retrieves events from postedevent queue 56, uses event information to access event processor pointertable 58 and calls event consumers 48 a–48 n. In another configuration,initial event handler 54 is in communication with and calls extendedevent API 52, instead of one or more of event consumers 48 a–48 n.

Posted event queue 56 holds event information in event elements 60 a–60d. In one example embodiment, posted event queue 56 is a circular queuewith up to 256 elements in memory 30. However, posted event queue 56 canbe other suitable sizes and can be adjusted to accommodate user needs.Also, other embodiments of posted event queue 56 are not implemented ascircular queues. For example, other embodiments of posted event queue 56include a linked list queue and an array. Each event element 60 a–60 dcontains information about an event from one of the event producers 46a–46 n.

Event processor pointer table 58 includes pointers to processors 62 a–62n for handling events. These processors for handling events are eitherevent consumers 48 a–48 n or extended event API 52. In oneconfiguration, wherein performance path API 50 does not call extendedevent API 52, the pointers 62 a–62 n correspond directly, on a one toone basis, with the event consumers 48 a–48 n (i.e., pointer 62 a pointsto event consumer 48 a, pointer 62 b points to event consumer 48 b, . .. and pointer 62 n points to event consumer 48 n). In thisconfiguration, each pointer 62 points to only one event processor.

FIG. 4 is a block diagram illustrating one exemplary embodiment of amethod for posting and retrieving events from posted event queue 56.Initial event handler 54 posts events to posted event queue 56 at aproducer index 64 and retrieves events from posted event queue 56 at aconsumer index 66. Producer index 64 points to the next available spacein posted event queue 56 (i.e., the element or space following eventelement 60 d). After an event has been posted, initial event handler 54increments producer index 64 to point to the next available space.Consumer index 66 points to the next event to be processed (i.e., eventelement 60 a). Initial event handler 54 increments consumer index 66 toremove one of event 60 a–60 d from posted event queue 56. With postedevent queue 56 implemented as a circular queue, events removed byincrementing consumer index 66 are over-written by new events posted toposted event queue 56.

FIG. 5 is a diagram illustrating one exemplary embodiment of an eventdata structure 68 for the event elements 60 a–60 d in posted event queue56. Event data structure 68 includes an identification (ID) section 70,a sub-event category section 72, and a data section 74. ID section 70 isan index into event processor pointer table 58. Accordingly, initialevent handler 54 uses ID section 70 (i.e., the index) to select anappropriate one of pointers 62 a–62 n. Sub-event category section 72contains information that categorizes the event into a particular group.With group information, an event processor can handle all events in aparticular group in the same manner. Data section 74 includes relevantevent data or a pointer to relevant event data in memory 30. Event datastructure 68 is passed along for event processing.

FIG. 6 is a diagram illustrating one exemplary embodiment of a firstresponse 80 to initial event handler 54. First response 80 is passedback to initial event handler 54 from either one of event consumers 48a–48 n or extended event API 52. In one embodiment, first response 80includes bit zero indicated at 82, which indicates success with a zeroand retry with a one. In one embodiment, first response 80 also includesbit one indicated at 84, which indicates not moved with a zero and movedwith a one.

In operation, operating system 42 calls event management system 44 toprocess new events and continue processing posted events 60 a–60 d.Initial event handler 54 configures each new event into an event datastructure 68 having an ID section 70, a sub-event category section 72,and a data section 74. Initial event handler 54 also checks each newevent and, based on preprogrammed criteria, either attempts processingthe new event immediately or posts the new event to posted event queue56. To immediately process the new event, initial event handler 54 callsan event processor, either one of the event consumers 48 a–48 n or theextended event API 52. Initial event handler 54 passes event datastructure 68 to the event processor during the call operation. If thenew event is successfully processed or moved, the new event is neverposted to posted event queue 56. However, if a retry is indicated,initial event handler 54 posts the new event to posted event queue 56.New events are posted to posted event queue 56 by placing the event datastructure 68 in posted event queue 56 at the producer index 64, which inone embodiment is the next available space in posted event queue 56. Inone embodiment, initial event handler 54 posts all new events to postedevent queue 56.

Initial event handler 54 uses consumer index 66 to process posted events60 a–60 d from posted event queue 56. Initial event handler 54 retrievesone of the events 60 a–60 d at the consumer index 66. Initial eventhandler 54 employs the ID section 70 from the retrieved event 60 as anindex into event processor pointer table 58 to thereby retrieve aselected pointer to a processor 62 from event processor pointer table58. Next, initial event handler 54 calls the event processor pointed toby the selected pointer to the processor 62. This event processor iseither one of the event consumers 48 a–48 n or the extended event API52.

The following example operation is provided for better understanding ofevent management system 44. Assume for this example that ID section 70from event 60 a indexes the pointer to processor 62 c in event processorpointer table 58. Assume further, that pointer to processor 62 c pointsto event consumer 48 c, as illustrated in FIG. 3. To begin, initialevent handler 54 retrieves event 60 a from posted event queue 56 at theconsumer index 66. Initial event handler 54 takes the ID section 70 fromevent 60 a for an index. Since, for this example, ID section 70 indexespointer to processor 62 c, initial event handler 54 retrieves pointer toprocessor 62 c from event processor pointer table 58. Next, initialevent handler 54 calls the event consumer 48 c pointed to by pointer toprocessor 62 c. As with immediate processing of a new event, initialevent handler 54 passes the event data structure 68 to the eventconsumer 48 c during the call operation.

To continue the example, event consumer 48 c attempts to process theevent 60 a and passes first response 80 back to initial event handler54. First response 80 indicates success, retry, or moved. Where successis indicated, initial event handler 54 increments the consumer index 66to remove the successfully processed event 60 a from posted event queue56. Initial event handler 54 proceeds to either process the next event60 b or pass control back to operating system 42. One reason control ispassed back to operating system 42 is to limit the number of events thatcan be processed by event management system 44 during any one call.Thus, in one embodiment, if a defined number of events have already beenprocessed by event management system 44 during the current call,processing is returned to operating system 42.

When first response 80 indicates retry, initial event handler 54 doesnot increment consumer index 66 and immediately passes control tooperating system 42. In each of these situations, success and retry,memory 30 associated with processing the event 60 a is freed or releasedto the computer system 20 after first response 80 is received by initialevent handler 54. In this manner, event management system 44 keepsmemory 30 free for use in computer system 20.

When first response 80 indicates moved, initial event handler 54increments consumer index 66 to remove the event 60 a from posted eventqueue 56. Initial event handler 54 proceeds to process the next event 60b or pass control back to operating system 42. A moved responseindicates that the event 60 a has been moved to another queue. In onescenario, this is because the resources needed for processing the event60 a are not available. Thus, posted event queue 56 is not blocked bythe moved event. Memory 30 associated with a moved event is not freed.

FIG. 7 is a block diagram illustrating an exemplary embodiment ofperformance path API 50 configured to call extended event API 52.Performance path API 50 includes initial event handler 54, posted eventqueue 56, and event processor pointer table 58. Initial event handler 54is in communication with event producers 46 a–46 n, event consumers 48a, 48 b, 48 d–48 n, and extended event API 52. In the configurationillustrated in FIG. 7, initial event handler 54 is not in directcommunication with event consumer 48 c, because extended event handler52 has taken the position previously occupied by event consumer 48 c. Inother performance path API 50 configurations, extended event handler 52takes the place of any one, all or none of the event consumers 48 a–48n.

Initial event handler 54 has numerous functions. For example, initialevent handler 54 controls posted event queue 56 and accesses eventprocessor pointer table 58. Initial event handler 54 receives eventsfrom event producers 46 a–46 n and posts events to posted event queue56. Initial event handler 54 also retrieves events from posted eventqueue 56, uses event information to access event processor pointer table58 and calls event consumers 48 a, 48 b, 48 d–48 n or the extended eventAPI 52.

Posted event queue 56 holds event information in event elements 60 a–60d. In one example embodiment, posted event queue 56 is a circular queuewith up to 256 elements in memory 30. However, posted event queue 56 canbe other suitable sizes and can be adjusted to accommodate user needs.Also, other embodiments of posted event queue 56 are not implemented ascircular queues. For example, other embodiments of posted event queue 56include a linked list queue and an array. Each event element 60 a–60 dcontains information about an event from one of the event producers 46a–46 n.

Event processor pointer table 58 includes pointer to processor elements62 a–62 n for handling events. In the configuration illustrated in FIG.7, the processors for handling events are event consumers 48 a, 48 b, 48d–48 n and the extended event API 52. In this configuration, performancepath API 50 calls the extended event API 52 instead of event consumer 48c. For example, pointer 62 a points to event consumer 48 a, pointer 62 bpoints to event consumer 48 b, pointer 62 c points to the extended eventAPI 52, pointer 62 d points to event consumer 48 d, . . . , and pointer62 n points to event consumer 48 n.

FIG. 8 is a block diagram illustrating one exemplary embodiment ofextended event API 52. Extended event API 52 includes an extended eventhandler 90, an extended event lookup table 92, and an extended pointertable 94. Extended event handler 90 has numerous functions. For examplea call to extended event API 52 is actually call to extended eventhandler 90. Extended event handler 90 manages and retrieves entries fromextended event lookup table 92. Extended event handler 90 retrievespointers from extended pointer table 94. Also, extended event handler 90uses the retrieved pointers to call event consumers 48 a–48 z.

Extended event lookup table 92 includes event entries that extendedevent API 52 can process. These event entries include retry vectors 96a–96 n and head vectors 98 a–98 n. The retry vectors 96 a–96 b and headvectors 98 a–n are indexes into extended pointer table 94.

Extended pointer table 94 includes entries, which point to selectedevents consumers 48 a–48 z. Each entry in extended pointer table 94contains one of event consumer pointers 100 a–100 n and a correspondingnext pointer 102 a–102 n. Each one of event consumer pointers 100 a–100n points to a corresponding one of event consumers 48 a–48 z. Each oneof next pointers 102 a–102 n points to one of the entries in extendedpointer table 94 to link one of event consumer pointers 100 a–100 n toanother one of event consumer pointers 100 a–100 n. Event managementsystem 44 employs extended pointer table 94 to execute multiple eventconsumers 48 a–48 z in a series for processing a single event.

FIG. 9 is a diagram illustrating one embodiment of a second response 104passed from one of event consumers 48 a–48 z to extended event handler90. Second response 104 includes a bit zero indicated at 106, a bit oneindicated at 108, and a bit two indicated at 110. In one embodiment, bitzero indicated at 106 indicates success with a zero and retry with aone. In one embodiment, bit one indicated at 108 indicates not movedwith a zero and moved with a one. In one embodiment, bit two indicatedat 110 indicates pass to next with a zero and event consumed with a one.Extended event handler 90 directs processing to the next selected one ofevent consumers 48 a–48 z or back to initial event handler 54 usingsecond response 104.

In operation, the operating system 42 calls the event management system44 to process new events and continue processing posted events 60 a–60d. The initial event handler 54 configures each new event into an eventdata structure 68 having an ID section 70, a sub-event category section72, and a data section 74. Initial event handler 54 also checks each newevent and, based on preprogrammed criteria, either attempts processingthe new event immediately or posts the new event to posted event queue56. To immediately process the new event, initial event handler 54 callsan event processor, either one of the event consumers 48 a–48 n or theextended event API 52. Initial event handler 54 passes event datastructure 68 to the event processor during this call operation. If thenew event is successfully processed or moved, the new event is neverposted to posted event queue 56. However, if a retry is indicated,initial event handler 54 posts the new event to posted event queue 56.New events are posted to posted event queue 56 by placing the event datastructure 68 in posted event queue 56 at the producer index 64, which inone embodiment is the next available space in posted event queue 56. Inone embodiment, initial event handler 54 posts all new events to postedevent queue 56.

Initial event handler 54 uses consumer index 66 to process posted events60 a–60 d from posted event queue 56. Initial event handler 54 retrievesone of the events 60 a–60 d at the consumer index 66. Initial eventhandler 54 employs the ID section 70 from the retrieved event as anindex into event processor pointer table 58 to thereby retrieve aselected pointer to a processor 62 from the event processor pointertable 58. Next, initial event handler 54 calls the event processorpointed to by the selected pointer to the processor 62. This eventprocessor is either one of the event consumers 48 a–48 n or the extendedevent API 52.

The following example operation includes a call to extended event API 52and is provided for a better understanding of event management system44. Assume for this example that ID section 70 from event 60 a indexesthe pointer to processor 62 c in event processor pointer table 58. Inaddition, in the present example assume further, that pointer toprocessor 62 c points to extended event API 52, as illustrated in FIG.7, not event consumer 48 c. To begin, initial event handler 54 retrievesevent 60 a from posted event queue 56 at the consumer index 66. Initialevent handler 54 takes the ID section 70 from event 60 a for an index.Since, for this example, ID section 70 indexes pointer to processor 62c, initial event handler 54 retrieves the pointer to processor 62 c fromevent processor pointer table 58. Next, initial event handler 54 callsextended event API 52, instead of event consumer 48 c. As with immediateprocessing of a new event, initial event handler 54 passes the eventdata structure 68 to extended event API 52 during the call operation.Processing continues with extended event API 52.

A call to extended event API 52 is actually a call to extended eventhandler 90, which continues processing by retrieving the ID section 70from event 60 a. ID section 70 is used as an index into extended eventlookup table 92. Extended event handler 90 retrieves the retry vector 96c from extended event lookup table 92, as illustrated in FIG. 8 by thedashed line and arrow from extended event handler 90 to extended eventlookup table 92. Initial event handler 90 determines if the retry vector96 c is null. If the retry vector 96 c is not null, extended eventhandler 90 uses the retry vector 96 c to access extended pointer table94. However, if the retry vector 96 c is null, extended event handler 90retrieves the head vector 98 c to access extended pointer table 94.

In the present example, the retry vector 96 c is null and the headvector 98 c is used to retrieve event consumer pointer 100 a, asillustrated in FIG. 8 by the dashed line and arrow from the head vector98 c to event consumer pointer 100 a. Event consumer pointer 100 apoints to any one of the event consumers 48 a–48 z. Extended eventhandler 90 calls the selected one of event consumers 48 a–48 z forprocessing event 60 a.

The one of event consumers 48 a–48 z called by extended event handler 90passes a second response 104 to extended event handler 90. The secondresponse 104 indicates success or retry; not moved or moved; and pass tonext or event consumed. If second response 104 indicates success andevent consumed, extended event handler 90 passes a first response 80indicating success to initial event handler 54 and nothing is placedinto the retry vector 96 c. Initial event handler 54 increments theconsumer index 66 to remove event 60 a from posted event queue 56 andeither processes the next event 60 b or passes control back to operatingsystem 42.

When the second response 104 indicates success and pass to next,extended event handler 90 retrieves the next pointer 102 a and accessesextended pointer table 94 to retrieve event consumer pointer 10 b. Eventconsumer pointer 100 b is used by extended event handler 90 to call oneof the event consumers 48 a–48 z. Processing continues in the selectedone of event consumers 48 a–48 z, which passes another second response104 to extended event handler 90.

When the second response 104 indicates retry, extended event handler 90sets the retry vector 96 c to index event consumer pointer 100 a. Next,extended event handler 90 passes a first response 80 indicating retryback to initial event handler 54. Initial event handler 54 does notincrement the consumer index 66 and immediately passes control back tooperating system 42. The next time operating system 42 calls eventmanagement system 44, processing from posted event queue 56 continueswith event 60 a. Extended event API 52 is called and the retry vector 96c is used to index event consumer pointer 100 a. Extended event handler90 calls the same one of event consumers 48 a–48 z to resume processing.

When the second response 104 indicates moved, extended event handler 90does not set the retry vector 96 c and passes a first response, 80indicating moved to initial event handler 54. Initial event handler 54increments the consumer index 66 to remove event 60 a from posted eventqueue 56. Initial event handler 54 proceeds with processing the nextevent 60 b or passes control back to operating system 42.

As before, when the first response 80 indicates success or retry, memory30 associated with processing event 60 a is freed for use in computersystem 20. However, where the first response 80 indicates moved, memory30 is not freed.

FIG. 10 is a flow chart illustrating new event processing, includingimmediately processing the new event and posting the new event,according to one embodiment of the present invention. To start, asindicated at 200, an event producer 46 generates a new event in computersystem 20. Operating system 42 retrieves and stores the new event forthe next time operating system 42 calls event management system 44. Atthis time, as indicated at 202, operating system 42 passes the new eventinformation to performance path API 50 and initial event handler (IEH)54. Initial event handler 54 configures the event information into anevent data structure 68 and decides, at 204, whether to post the newevent. At 206, if the new event is posted, initial event handler 54places the event data structure 68 in posted event queue 56 at theproducer index 64. At 214, initial event handler 54 then continues toprocess the next event in posted event queue 56 or passes control tooperating system 42. In one scenario, however, initial event handler 54has instructions to immediately process the new event before posting thenew event.

At 208, when the new event is processed before posting, initial eventhandler 54 obtains the index and retrieves the pointer to a selectedevent processor. At 210, initial event handler 54 then calls the eventprocessor using this pointer. This event processor can be either one ofthe event consumers 48 a–48 n or the extended event API 52. In eithersituation, the event processor attempts to process the new event andpasses the first response 80 back to initial event handler 54, whichdetermines, at 212, if the first response 80 indicates success or moved,as opposed to retry. If processing was successful or the new event wasmoved, initial event handler 54 passes control back to operating system42 or proceeds to process the next event, as indicated at 214. On theother hand, if the first response 80 indicates retry, initial eventhandler 54 posts the event, at 206, by placing the new event datastructure 68 into posted event queue 56 at the producer index 64. From206, initial event handler 54 processes the next event or passes controlto operating system 42, as indicated at 214.

FIG. 11 is a flow chart illustrating event processing from posted eventqueue 56 in one exemplary embodiment of performance path API 50,according to one embodiment of the present invention. At 300, eventprocessing begins with operating system 42 calling performance path API50 and initial event handler 54 from the main loop of the operatingsystem. After processing new events and to continue processing postedevents, initial event handler 54, at 302, retrieves an event from postedevent queue 56 at the consumer index 66. At 304, initial event handler54 employs the index from the selected event and looks up the pointer tothe corresponding event processor. Initial event handler 54 then callsthe event processor, at 306, which returns the first response 80 toinitial event handler 54, at 308. This first response 80 containssuccess, retry, and moved indicators.

At 310, initial event handler 54 checks the success indicator. If eventprocessing was successful, initial event handler 54 updates the consumerindex 66, at 312, to remove the event from posted event queue 56.Initial event handler 54 then determines, at 314, if event processing iscomplete or the limit has been reached. If processing is not complete,initial event handler 54, at 302, retrieves the next event from postedevent queue 56 and continues event processing. However, if processing iscomplete or the limit has been reached, initial event handler 54 passescontrol back to operating system 42, as indicated at 316.

When the first response 80 does not indicate success, initial eventhandler 54 determines, at 318, if the event was moved. If the event wasnot moved, retry is indicated and control is passed to operating system42, as indicated at 316. If the event was moved, initial event handler54 updates the consumer index 66, at 312, to remove the event fromposted event queue 56. Event processing continues as if the event hadbeen successful.

FIGS. 12, 13, and 14 are flow charts illustrating event processingthrough an exemplary embodiment of extended event API 52, according toone embodiment of the present invention. At 400 in FIG. 12, eventprocessing begins with operating system 42 calling performance path API50 and initial event handler 54 from the main loop of the operatingsystem. By way of example, assume that initial event handler 54immediately begins processing events from posted event queue 56. Inanother example, initial event handler 54 calls extended event API 52while immediately processing a new event. At 402, initial event handler54 retrieves an event from posted event queue at the consumer index 66.Initial event handler 42 employs the ID section 70 from the retrievedevent to use as an index into event processor pointer table 58. At 404,initial event handler 54 looks up the pointer to an event processor,which in this example is a pointer to extended event API 52 and therebyis actually a pointer to extended event handler 90 in the extended eventAPI. At 406, initial event handler 54 uses the selected pointer to callextended event handler 90 for event processing. Event processingcontinues in extended event API 52 with extended event handler 90.

FIG. 13 is a flow chart illustrating event processing through theexemplary embodiment of extended event API 52, according to oneembodiment of the present invention. Extended event handler 90 receivesevent data in the call instruction from initial event handler 54. At500, extended event handler 90, employing the event ID section 70 as anindex, retrieves a retry vector 96 from extended event lookup table 92.At 502, extended event handler 90 checks the retry vector 96 for a nullcondition. If the retry vector 96 is null, extended event handler 90uses a corresponding head vector 98, as indicated at 504. Alternatively,if the retry vector 96 is not null, extended event handler 90 uses theretry vector 96, as indicated at 506.

In one embodiment, extended event handler 90 makes a working copy of theretry vector 96, and uses the copy of the retry vector 96. The retryvector 96 in extended event lookup table 92 is then cleared, at 508.Processing continues with extended event handler 90 looking up the eventconsumer pointer from extended pointer table 94, as indicated at 510,using the head vector 98 or the retry vector 98. Extended event handler90 calls the event consumer 48, at 512, and the event consumer 48responds to extended event handler 90 with a second response 104, at514. This second response 104 contains indicators for success or retry;moved or not moved; and pass to next or event consumed.

At 516, extended event handler 90 checks the second response 104. Whenthe second response 104 indicates success, extended event handler 90, at518, continues to check whether the event was consumed. If the event wassuccessfully processed and consumed, extended event handler 90 passescontrol back to initial event handler 54, as indicated at 520. In thissituation, extended event handler 90 passes a first response 80indicating success back to initial event handler 54.

When the event was successfully processed but not consumed, extendedevent handler 90, at 522, looks up the pointer to the next eventconsumer. At 524, extended event handler 90 checks the next pointer. Ifthe next pointer is null, processing is passed to initial event handler54, at 520, with success indicated. If the next pointer is not null,processing continues, at 510, with the extended event handler 90 lookingup the next event consumer pointer for processing.

When the second response 104 indicates the event was not processedsuccessfully, at 516, the second response is further checked, at 526, todetermine if the event was moved. If the event was moved, processing isreturned to initial event handler 54, at 520, with moved indicated.However, if the event was not moved a retry is indicated and extendedevent handler 90, at 528, sets the retry vector 96 in extended eventlook up table 92. Processing is then returned to initial event handler54 with the retry indicator set, at 520. Thus, event processing iseventually returned from extended event handler 90 to initial eventhandler 54.

FIG. 14 is a flow chart illustrating event processing through theexemplary embodiment of performance path API 50 after returning fromextended event API 52, according to one embodiment of the presentinvention. At 600, processing returns to initial event handler 54 fromextended event handler 90 with the first response 80. Initial eventhandler 54 checks the first response 80, at 602, to determine if eventprocessing was successful. If event processing was successful, initialevent handler 54 updates the consumer index 66, at 604, to remove theevent from posted event queue 56. At 606, initial event handler 54checks to determine if event processing is completed or if the limit hasbeen reached. If event processing is complete, initial event handler 54passes control back to the main loop of operating system 42, asindicated at 608. If event processing is not complete, initial eventhandler 54 processes the next event in posted event queue 56, asindicated at 610.

When the first response 80, passed from extended event handler 90,indicates event processing was not successful, initial event handler 54checks, at 612, to determine if the event was moved. If the event wasnot moved, a retry is indicated and initial event handler 54 returnsprocessing to the main loop of operating system 42, at 608. However, ifthe event was moved, processing continues at 604 where initial eventhandler 54 updates the consumer index 66 to remove the event from postedevent queue 56. Initial event handler 54 then checks to determine ifprocessing is complete, at 606. If processing is complete, control ispassed to the main loop of operating system 42, at 608. If processing isnot complete, processing continues with the next event in posted eventqueue 56, as indicated at 610.

Although specific embodiments have been illustrated and described hereinfor purposes of description of the preferred embodiment, it will beappreciated by those of ordinary skill in the art that a wide variety ofalternate and/or equivalent implementations calculated to achieve thesame purposes may be substituted for the specific embodiments shown anddescribed without departing from the scope of the present invention.Those with skill in the chemical, mechanical, electromechanical,electrical, and computer arts will readily appreciate that the presentinvention may be implemented in a very wide variety of embodiments. Thisapplication is intended to cover any adaptations or variations of thepreferred embodiments discussed herein. Therefore, it is manifestlyintended that this invention be limited only by the claims and theequivalents thereof.

1. An event management system, operating on a computer system havingevent producers and event consumers, the event management systemcomprising: an initial event handler program; an event queue having afirst event, wherein the initial event handler program retrieves thefirst event from the event queue for event processing that returns afirst response to the initial event handler program, wherein the initialevent handler program manages the first event on the event queue basedon the first response; an extended event handler program, wherein theinitial event handler program uses the first event to call the extendedevent handler program for further event processing; and an extendedevent, wherein the extended event handler program retrieves the extendedevent for further event processing and the extended event includes aretry vector and a head vector, wherein the head vector relates to thebeginning of a chain of event consumers and the retry vector relates towhere processing left off in the chain of event consumers.
 2. The eventmanagement system of claim 1, further comprising an event processorpointer in a pointer table, wherein the initial event handler programuses the first event to look up the event processor pointer from thepointer table.
 3. The event management system of claim 2, wherein thefirst event includes an index into the pointer table, wherein theinitial event handler program uses the index to look up the eventprocessor pointer.
 4. The event management system of claim 2, whereinthe event processor pointer points to one of the event consumers,wherein the initial event handler program uses the event processorpointer to call the event consumer.
 5. The event management system ofclaim 2, wherein the event processor pointer points to the extendedevent handler program, wherein the initial event handler program usesthe event processor pointer to call the extended event handler programfor further event processing.
 6. The event management system of claim 5,further comprising an extended event lookup table that includes theextended event.
 7. The event management system of claim 6, furthercomprising extended pointers in an extended pointer table, wherein theextended event handler program uses the extended event to look up oneextended pointer from the extended pointer table.
 8. The eventmanagement system of claim 7, wherein the extended event includes theretry vector and the head vector indexing extended pointers in theextended pointer table, wherein the extended event handler program usesthe retry vector to look up a first extended pointer unless the retryvector is null, wherein the head vector is used to look up a secondextended pointer where the retry vector is null.
 9. The event managementsystem of claim 5, wherein the extended event handler program receives asecond response, which includes event processing result indicators. 10.The event management system of claim 9, further comprising an extendedpointer table having extended pointers including an event consumerpointer and a next event consumer pointer, wherein the extended eventhandler program uses the next event consumer pointer for further eventprocessing where the second response indicates success and pass to next.11. The event management system of claim 9, wherein the second responseindicates success and consumed, and the extended event handler programreturns success in the first response to the initial event handlerprogram.
 12. The event management system of claim 9, wherein the secondresponse includes retry, wherein the extended event handler programreturns retry in the first response to the initial event handlerprogram.
 13. The event management system of claim 1, wherein the firstresponse indicates retry and the initial event handler program leavesthe first event in the event queue.
 14. The event management system ofclaim 1, wherein the first response is success or moved and the initialevent handler program removes the first event from the event queue. 15.The event management system of claim 1, wherein the first response issuccess or retry and the initial event handler program frees memoryassociated with the first event.
 16. The event management system ofclaim 1, wherein a second event is received by the initial event handlerprogram from the event producers, wherein the initial event handlerprogram posts the second event to the end of the event queue.
 17. Theevent management system of claim 16, wherein the initial event handlerprogram posts the second event to the event queue in an event datastructure having an ID section, a sub-category section and a datasection.
 18. A method for managing events in a computer system includingat least one processor and memory and having event producers and eventconsumers, the method comprising: executing an initial event handlerprogram that is stored in the memory and configured to schedule eventsthat are requests for some action; retrieving an event from an eventqueue, wherein the event queue has at least one event from one of theevent producers; calling an event processor for processing the retrievedevent and returning a first response; receiving the first response fromthe event processor, wherein the first response indicates a result ofprocessing the retrieved event; and managing the retrieved event on theevent queue based on the first response, wherein calling an eventprocessor comprises: calling an extended event handler program based onthe first event; and analyzing an extended event via the extended eventhandler program, which includes: determining if a retry vector is null,wherein the retry vector indicates which event consumer in a chain ofevent consumers processing left off at; retrieving the retry vectorwhere the retry vector is not null; and retrieving a head vector wherethe retry vector is null, wherein the head vector indicates thebeginning of the chain of event consumers.
 19. The method of claim 18,wherein calling an event processor comprises calling one of the eventconsumers.
 20. The method of claim 18, further comprising: looking upthe extended event from an extended event lookup table; analyzing theextended event for an indexing vector; and looking up an extendedpointer using the indexing vector, wherein calling the chain of eventconsumers includes using the extended pointer.
 21. The method of claim18, further comprising receiving a second response from one of the eventconsumers in the chain of event consumers, wherein the second responseindicates the results of event processing.
 22. The method of claim 21,further comprising: looking up an extended pointer entry having an eventconsumer pointer and a next event consumer pointer; and using the nextevent consumer pointer where the second response indicates success andpass to next.
 23. The method of claim 18, wherein managing the retrievedevent includes leaving the retrieved event on the queue or removing theretrieved event from the queue based on the first response.
 24. Themethod of claim 18, wherein retrieving an event includes retrieving aconsumer index that points to the event in the event queue and indexingthe event in the event queue using the consumer index.
 25. The method ofclaim 18, further comprising: receiving an event from one of the eventproducers; organizing the event into an event data structure; andposting the event data structure to the event queue.
 26. A computersystem, comprising: memory storing an initial event handler programconfigured to schedule events that are requests for some action, anevent queue, an extended event handler program and an extended event,wherein the initial event handler program has instructions includingevent queue posting instructions, event queue retrieving instructionsand event queue management instructions and the extended event includesa retry vector and a head vector, wherein the head vector relates to thebeginning of a chain of event consumers and the retry vector relates towhere processing left off in the chain of event consumers; and aprocessor, which executes the initial event handler program, wherein theprocessor executes to event queue posting instructions to post a newevent to the event queue and wherein the processor executes the eventqueue retrieving instructions to retrieve a posted event from the eventqueue for event processing that returns a first response to theprocessor, wherein the processor executes the initial event handlerprogram to call the extended event handler program for further eventprocessing based on the posted event retrieved from the event queue andthe processor executes the extended event handler program to retrievethe extended event for further event processing, wherein the processorexecutes the event queue management instructions to manage the retrievedevent on the event queue based on the first response.
 27. The computersystem of claim 26, wherein the memory includes a pointer to eventprocessing in a pointer table and the processor executes the initialevent handler program to analyze the posted event retrieved from theevent queue and look up the pointer to event processing.
 28. Thecomputer system of claim 26, wherein the first response is retry and theprocessor executes the event queue management instructions to leave theretrieved event on the event queue.
 29. The computer system of claim 26,wherein the first response is success or moved and the processorexecutes the event queue management instructions to remove the retrievedevent from the event queue.
 30. The computer system of claim 26, whereinthe first response is success or retry and the processor executes theinitial event handler program to free memory associated with theretrieved event.
 31. The computer system of claim 26, wherein theprocessor executes the extended event handler program to call more thanone event consumer.
 32. An event management system, operating on acomputer system including at least one processor and memory configuredto store the event management system and having event producers andevent consumers, the event management system comprising: an initialevent handler program configured to schedule events that are requestsfor some action; an event queue having a first event, wherein theinitial event handler program retrieves the first event from the eventqueue for event processing that returns a first response to the initialevent handler program, wherein the initial event handler program managesthe first event on the event queue based on the first response; anextended event handler program, wherein the initial event handlerprogram uses the first event to call the extended event handler programfor further event processing; and an extended event wherein the extendedevent handler program retrieves the extended event for further eventprocessing and the extended event includes a retry vector and a headvector, wherein the head vector relates to the beginning of a chain ofevent consumers and the retry vector relates to where processing leftoff in the chain of event consumers.